	//
	//  GaoCvImageLabelCell.m
	//  OpenglDemo
	//
	//  Created by Gikki Ares on 2020/6/24.
	//



#import "JsMenuItemView.h"

@interface Prefix(MenuItemView)()
{
	UILabel *mlbl_title;
	UIImageView *miv;
	UIImage * mimage_selected;
	UIImage * mimage_unselected;
}

@end

@implementation Prefix(MenuItemView)

- (instancetype)init
{
	self = [super init];
	if (self) {
		[self commonInit];
	}
	return self;
}

- (instancetype)initWithFrame:(CGRect)frame
{
	self = [super initWithFrame:frame];
	if (self) {
		[self commonInit];
	}
	return self;
}

- (void)awakeFromNib {
	[super awakeFromNib];
		// Initialization code
	[self commonInit];
	
}


- (void) commonInit {
//	miv = [[UIImageView alloc]init];
//	[self addSubview:miv];
//	mlbl_title = [[UILabel alloc]init];
//	[self addSubview:mlbl_title];
//	mlbl_title.textAlignment = NSTextAlignmentCenter;
}

- (void)setVm:(JsMenuItemVm *)vm {
	
}
- (void)setupUi {
	
}

- (void)setSelected:(BOOL)selected {
	[super setSelected:selected];
	if(self.selected) {
		miv.image = mimage_selected;
	}
	else {
		miv.image = mimage_unselected;
	}
}

- (UIImage *)imageWithName:(NSString *)imageName {
	UIImage * image = nil;
#if 1
	image = [UIImage imageNamed:imageName];
#else
	image = [[UIImage alloc]initWithContentsOfFile:imageName];
#endif
	return image;
}

@end
